package gy.rpc.api.dto;

import java.io.Serializable;

/**
 * @author G_Y
 * @date 2018年4月22日
 * @说明: 封装rpc调用的请求参数
 */
public class RequestDTO implements Serializable {
	
	public RequestDTO() {
	}
	
	public RequestDTO(String intfcName, String methodName, Object[] args, String rpcId) {
		this.intfcName = intfcName;
		this.methodName = methodName;
		this.args = args;
		this.rpcId = rpcId;
	}
	
	public RequestDTO(String intfcName, String methodName, Object[] args) {
		this.intfcName = intfcName;
		this.methodName = methodName;
		this.args = args;
	}

	/**
	 * 可序列化
	 */
	private static final long serialVersionUID = -7899084446874610220L;
	
	/**
	 * 请求api接口类型 名称
	 */
	private String intfcName;
	
	/**
	 * 请求的方法名
	 */
	private String methodName;
	
	/**
	 * 请求方法的参数
	 */
	private Object[] args;
	
	/**
	 * rpc调用唯一区分
	 */
	private String rpcId;

	/**
	 * @return the intfcName
	 */
	public String getIntfcName() {
		return intfcName;
	}

	/**
	 * @param intfcName the intfcName to set
	 */
	public RequestDTO setIntfcName(String intfcName) {
		this.intfcName = intfcName;
		return this;
	}

	/**
	 * @return the methodName
	 */
	public String getMethodName() {
		return methodName;
	}

	/**
	 * @param methodName the methodName to set
	 */
	public RequestDTO setMethodName(String methodName) {
		this.methodName = methodName;
		return this;
	}

	/**
	 * @return the args
	 */
	public Object[] getArgs() {
		return args;
	}

	/**
	 * @param args the args to set
	 */
	public RequestDTO setArgs(Object[] args) {
		this.args = args;
		return this;
	}

	/**
	 * @return the rpcId
	 */
	public String getRpcId() {
		return rpcId;
	}

	/**
	 * @param rpcId the rpcId to set
	 */
	public RequestDTO setRpcId(String rpcId) {
		this.rpcId = rpcId;
		return this;
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		for (Object object : args) {
			sb.append(object.toString());
		}
		return sb.toString();
	}
	
	

}
